package com.ruoyi.product.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.product.mapper.TbTeacherMapper;
import com.ruoyi.product.domain.TbTeacher;
import com.ruoyi.product.service.ITbTeacherService;

/**
 * 所属教师Service业务层处理
 * 
 * @author Sun
 * @date 2023-01-30
 */
@Service
public class TbTeacherServiceImpl implements ITbTeacherService 
{
    @Autowired
    private TbTeacherMapper tbTeacherMapper;

    /**
     * 查询所属教师
     * 
     * @param teacherId 所属教师主键
     * @return 所属教师
     */
    @Override
    public TbTeacher selectTbTeacherByTeacherId(Integer teacherId)
    {
        return tbTeacherMapper.selectTbTeacherByTeacherId(teacherId);
    }

    /**
     * 查询所属教师列表
     * 
     * @param tbTeacher 所属教师
     * @return 所属教师
     */
    @Override
    public List<TbTeacher> selectTbTeacherList(TbTeacher tbTeacher)
    {
        return tbTeacherMapper.selectTbTeacherList(tbTeacher);
    }

    /**
     * 新增所属教师
     * 
     * @param tbTeacher 所属教师
     * @return 结果
     */
    @Override
    public int insertTbTeacher(TbTeacher tbTeacher)
    {
        tbTeacher.setCreateTime(DateUtils.getNowDate());
        return tbTeacherMapper.insertTbTeacher(tbTeacher);
    }

    /**
     * 修改所属教师
     * 
     * @param tbTeacher 所属教师
     * @return 结果
     */
    @Override
    public int updateTbTeacher(TbTeacher tbTeacher)
    {
        tbTeacher.setUpdateTime(DateUtils.getNowDate());
        return tbTeacherMapper.updateTbTeacher(tbTeacher);
    }

    /**
     * 批量删除所属教师
     * 
     * @param teacherIds 需要删除的所属教师主键
     * @return 结果
     */
    @Override
    public int deleteTbTeacherByTeacherIds(Integer[] teacherIds)
    {
        return tbTeacherMapper.deleteTbTeacherByTeacherIds(teacherIds);
    }

    /**
     * 删除所属教师信息
     * 
     * @param teacherId 所属教师主键
     * @return 结果
     */
    @Override
    public int deleteTbTeacherByTeacherId(Integer teacherId)
    {
        return tbTeacherMapper.deleteTbTeacherByTeacherId(teacherId);
    }
}
